<?php


namespace app\admin\model;


use think\Model;

class AfterServiceModel extends Model
{
    public function userInfo()
    {
        return $this->hasOne('WechatUserModel', 'id', 'user_id');
    }

    public function companyInfo()
    {
        return $this->hasOne('CompanyModel', 'id', 'company_id')->bind([
            'company_name' => 'name'
        ]);
    }

    public function getStatusAttr($value)
    {
        $status = [0 => '未处理', 1 => '已处理'];
        return $status[$value];
    }
}
